package com.forenow.demo.AnimalTest;

public class Duck extends Animal{  //继承关系
    String name;
    int legNum;

    public Duck(String name, int legNum) {
        this.name = name;
        this.legNum = legNum;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public void setName(String name) {
        this.name = name;
    }

    @Override
    public int getLegNum() {
        return legNum;
    }

    @Override
    public void setLegNum(int legNum) {
        this.legNum = legNum;
    }

    @Override
    //方法重写
    void shuot() {
        System.out.println("嘎嘎嘎");
    }

}
